<!DOCTYPE html>
<html lang="zh-Hans">
<head>

    <!--[if lt IE 9]>
        <style>body {display: none; background: none !important} </style>
        <meta http-equiv="Refresh" Content="0; url=//outdatedbrowser.com/" />
    <![endif]-->

<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge, chrome=1" />
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
<meta name="format-detection" content="telephone=no" />
<meta name="author" content="zhengweiMao" />



<meta name="description" content="Redis集群搭建序言 Redis简介 官网给的定义大概意思是：Redis是一个开源，内存数据结构存储，用作数据库，缓存和消息代理。它支持的数据结构有：字符串，哈希，列表，集合，有序集合，位图，超级日志和具有半径查询的地理空间索引。Redis是一个高性能的支持主从同步的key-value数据库。  缓存–中间件  Redis 配置文件  Redis 配置文件12345678910111213141">
<meta property="og:type" content="article">
<meta property="og:title" content="Redis集群搭建-配置文件">
<meta property="og:url" content="https://maozw.gitee.io/maoge-blog/2018/02/05/花神(maoge)/3.缓存-中间件/Redis 配置文件说明/index.html">
<meta property="og:site_name" content="花神">
<meta property="og:description" content="Redis集群搭建序言 Redis简介 官网给的定义大概意思是：Redis是一个开源，内存数据结构存储，用作数据库，缓存和消息代理。它支持的数据结构有：字符串，哈希，列表，集合，有序集合，位图，超级日志和具有半径查询的地理空间索引。Redis是一个高性能的支持主从同步的key-value数据库。  缓存–中间件  Redis 配置文件  Redis 配置文件12345678910111213141">
<meta property="og:locale" content="zh-Hans">
<meta property="og:updated_time" content="2018-08-05T12:52:07.127Z">
<meta name="twitter:card" content="summary">
<meta name="twitter:title" content="Redis集群搭建-配置文件">
<meta name="twitter:description" content="Redis集群搭建序言 Redis简介 官网给的定义大概意思是：Redis是一个开源，内存数据结构存储，用作数据库，缓存和消息代理。它支持的数据结构有：字符串，哈希，列表，集合，有序集合，位图，超级日志和具有半径查询的地理空间索引。Redis是一个高性能的支持主从同步的key-value数据库。  缓存–中间件  Redis 配置文件  Redis 配置文件12345678910111213141">

<link rel="apple-touch-icon" href= "/apple-touch-icon.png">


    <link rel="alternate" href="/atom.xml" title="花神" type="application/atom+xml">



    <link rel="shortcut icon" href="/favicon.png">



    <link href="//cdn.bootcss.com/animate.css/3.5.1/animate.min.css" rel="stylesheet">



    <link href="//cdn.bootcss.com/fancybox/2.1.5/jquery.fancybox.min.css" rel="stylesheet">



    <script src="//cdn.bootcss.com/pace/1.0.2/pace.min.js"></script>
    <link href="//cdn.bootcss.com/pace/1.0.2/themes/blue/pace-theme-minimal.css" rel="stylesheet">


<link rel="stylesheet" href="/maoge-blog/css/style.css">



<link href="//cdn.bootcss.com/font-awesome/4.6.3/css/font-awesome.min.css" rel="stylesheet">


<title>Redis集群搭建-配置文件 | 花神</title>

<script src="//cdn.bootcss.com/jquery/2.2.4/jquery.min.js"></script>
<script src="//cdn.bootcss.com/clipboard.js/1.5.10/clipboard.min.js"></script>

<script>
    var yiliaConfig = {
        fancybox: true,
        animate: true,
        isHome: false,
        isPost: true,
        isArchive: false,
        isTag: false,
        isCategory: false,
        fancybox_js: "//cdn.bootcss.com/fancybox/2.1.5/jquery.fancybox.min.js",
        scrollreveal: "//cdn.bootcss.com/scrollReveal.js/3.1.4/scrollreveal.min.js",
        search: true
    }
</script>


    <script>
        yiliaConfig.jquery_ui = [true, "//cdn.bootcss.com/jqueryui/1.10.4/jquery-ui.min.js", "//cdn.bootcss.com/jqueryui/1.10.4/css/jquery-ui.min.css"];
    </script>



    <script> yiliaConfig.rootUrl = "\/";</script>






</head>
<body>
  <div id="container">
    <div class="left-col">
    <div class="overlay"></div>
<div class="intrude-less">
    <header id="header" class="inner">
        <a href="/maoge-blog/" class="profilepic">
            <img src="img/avatar.png" class="animated zoomIn">
        </a>
        <hgroup>
          <h1 class="header-author"><a href="/maoge-blog/">zhengweiMao</a></h1>
        </hgroup>

        

        
            <form id="search-form">
            <input type="text" id="local-search-input" name="q" placeholder="search..." class="search form-control" autocomplete="off" autocorrect="off" searchonload="" />
            <i class="fa fa-times" onclick="resetSearch()"></i>
            </form>
            <div id="local-search-result"></div>
            <p class='no-result'>No results found <i class='fa fa-spinner fa-pulse'></i></p>
        


        
            <div id="switch-btn" class="switch-btn">
                <div class="icon">
                    <div class="icon-ctn">
                        <div class="icon-wrap icon-house" data-idx="0">
                            <div class="birdhouse"></div>
                            <div class="birdhouse_holes"></div>
                        </div>
                        <div class="icon-wrap icon-ribbon hide" data-idx="1">
                            <div class="ribbon"></div>
                        </div>
                        
                        <div class="icon-wrap icon-link hide" data-idx="2">
                            <div class="loopback_l"></div>
                            <div class="loopback_r"></div>
                        </div>
                        
                        
                        <div class="icon-wrap icon-me hide" data-idx="3">
                            <div class="user"></div>
                            <div class="shoulder"></div>
                        </div>
                        
                    </div>
                    
                </div>
                <div class="tips-box hide">
                    <div class="tips-arrow"></div>
                    <ul class="tips-inner">
                        <li>菜单</li>
                        <li>标签</li>
                        
                        <li>友情链接</li>
                        
                        
                        <li>关于我</li>
                        
                    </ul>
                </div>
            </div>
        

        <div id="switch-area" class="switch-area">
            <div class="switch-wrap">
                <section class="switch-part switch-part1">
                    <nav class="header-menu">
                        <ul>
                        
                            <li><a href="/maoge-blog/">主页</a></li>
                        
                            <li><a href="/maoge-blog/archives/">所有文章</a></li>
                        
                            <li><a href="/maoge-blog/tags/">标签云</a></li>
                        
                            <li><a href="/maoge-blog/categories/">分类</a></li>
                        
                            <li><a href="/maoge-blog/about/">关于我</a></li>
                        
                        </ul>
                    </nav>
                    <nav class="header-nav">
                        <ul class="social">
                            
                                <a class="fa Email" href="mailto:123@123.com" title="Email"></a>
                            
                                <a class="fa GitHub" href="#" title="GitHub"></a>
                            
                                <a class="fa RSS" href="/maoge-blog/atom.xml" title="RSS"></a>
                            
                        </ul>
                    </nav>
                </section>
                
                
                <section class="switch-part switch-part2">
                    <div class="widget tagcloud" id="js-tagcloud">
                        
                    </div>
                </section>
                
                
                
                <section class="switch-part switch-part3">
                    <div id="js-friends">
                    
                      <a class="main-nav-link switch-friends-link" href="https://hexo.io">Hexo</a>
                    
                      <a class="main-nav-link switch-friends-link" href="https://pages.github.com/">GitHub</a>
                    
                      <a class="main-nav-link switch-friends-link" href="http://moxfive.xyz/">MOxFIVE</a>
                    
                    </div>
                </section>
                

                
                
                <section class="switch-part switch-part4">
                
                    <div id="js-aboutme">专注于前端</div>
                </section>
                
            </div>
        </div>
    </header>                
</div>
    </div>
    <div class="mid-col">
      <nav id="mobile-nav">
      <div class="overlay">
          <div class="slider-trigger"></div>
          <h1 class="header-author js-mobile-header hide"><a href="/" title="回到主页">zhengweiMao</a></h1>
      </div>
    <div class="intrude-less">
        <header id="header" class="inner">
            <a href="/maoge-blog/" class="profilepic">
                <img src="img/avatar.png" class="animated zoomIn">
            </a>
            <hgroup>
              <h1 class="header-author"><a href="/maoge-blog/" title="回到主页">zhengweiMao</a></h1>
            </hgroup>
            
            <nav class="header-menu">
                <ul>
                
                    <li><a href="/maoge-blog/">主页</a></li>
                
                    <li><a href="/maoge-blog/archives/">所有文章</a></li>
                
                    <li><a href="/maoge-blog/tags/">标签云</a></li>
                
                    <li><a href="/maoge-blog/categories/">分类</a></li>
                
                    <li><a href="/maoge-blog/about/">关于我</a></li>
                
                <div class="clearfix"></div>
                </ul>
            </nav>
            <nav class="header-nav">
                        <ul class="social">
                            
                                <a class="fa Email" target="_blank" href="mailto:123@123.com" title="Email"></a>
                            
                                <a class="fa GitHub" target="_blank" href="#" title="GitHub"></a>
                            
                                <a class="fa RSS" target="_blank" href="/maoge-blog/atom.xml" title="RSS"></a>
                            
                        </ul>
            </nav>
        </header>                
    </div>
    <link class="menu-list" tags="标签" friends="友情链接" about="关于我"/>
</nav>
      <div class="body-wrap"><article id="post-花神(maoge)/3.缓存-中间件/Redis 配置文件说明" class="article article-type-post" itemscope itemprop="blogPost">
  
    <div class="article-meta">
      <a href="/maoge-blog/2018/02/05/花神(maoge)/3.缓存-中间件/Redis 配置文件说明/" class="article-date">
      <time datetime="2018-02-04T18:03:22.000Z" itemprop="datePublished">2018-02-05</time>
</a>


    </div>
  
  <div class="article-inner">
    
      <input type="hidden" class="isFancy" />
    
    
      <header class="article-header">
        
  
    <h1 class="article-title" itemprop="name">
      Redis集群搭建-配置文件
    </h1>
  

      </header>
      
      <div class="article-info article-info-post">
        
    <div class="article-category tagcloud">
    <a class="article-category-link" href="/maoge-blog/categories/缓存-中间件/">缓存-中间件</a>
    </div>


        
        <div class="clearfix"></div>
      </div>
      
    
    <div class="article-entry" itemprop="articleBody">
      
          
        <h3 id="Redis集群搭建"><a href="#Redis集群搭建" class="headerlink" title="Redis集群搭建"></a>Redis集群搭建</h3><p>序言</p>
<h4 id="Redis简介"><a href="#Redis简介" class="headerlink" title="Redis简介"></a>Redis简介</h4><ul>
<li>官网给的定义大概意思是：Redis是一个开源，内存数据结构存储，用作数据库，缓存和消息代理。它支持的数据结构有：字符串，哈希，列表，集合，有序集合，位图，超级日志和具有半径查询的地理空间索引。Redis是一个高性能的支持主从同步的key-value数据库。</li>
</ul>
<p>缓存–中间件</p>
<ul>
<li>Redis 配置文件</li>
</ul>
<h1 id="Redis-配置文件"><a href="#Redis-配置文件" class="headerlink" title="Redis 配置文件"></a>Redis 配置文件</h1><figure class="highlight"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br><span class="line">28</span><br><span class="line">29</span><br><span class="line">30</span><br><span class="line">31</span><br><span class="line">32</span><br><span class="line">33</span><br><span class="line">34</span><br><span class="line">35</span><br><span class="line">36</span><br><span class="line">37</span><br><span class="line">38</span><br><span class="line">39</span><br><span class="line">40</span><br><span class="line">41</span><br><span class="line">42</span><br><span class="line">43</span><br><span class="line">44</span><br><span class="line">45</span><br><span class="line">46</span><br><span class="line">47</span><br><span class="line">48</span><br><span class="line">49</span><br><span class="line">50</span><br><span class="line">51</span><br><span class="line">52</span><br><span class="line">53</span><br><span class="line">54</span><br><span class="line">55</span><br><span class="line">56</span><br><span class="line">57</span><br><span class="line">58</span><br><span class="line">59</span><br><span class="line">60</span><br><span class="line">61</span><br><span class="line">62</span><br><span class="line">63</span><br><span class="line">64</span><br><span class="line">65</span><br><span class="line">66</span><br><span class="line">67</span><br><span class="line">68</span><br><span class="line">69</span><br><span class="line">70</span><br><span class="line">71</span><br><span class="line">72</span><br><span class="line">73</span><br><span class="line">74</span><br><span class="line">75</span><br><span class="line">76</span><br><span class="line">77</span><br><span class="line">78</span><br><span class="line">79</span><br><span class="line">80</span><br><span class="line">81</span><br><span class="line">82</span><br><span class="line">83</span><br><span class="line">84</span><br><span class="line">85</span><br><span class="line">86</span><br><span class="line">87</span><br><span class="line">88</span><br><span class="line">89</span><br><span class="line">90</span><br><span class="line">91</span><br><span class="line">92</span><br><span class="line">93</span><br><span class="line">94</span><br><span class="line">95</span><br><span class="line">96</span><br><span class="line">97</span><br><span class="line">98</span><br><span class="line">99</span><br><span class="line">100</span><br><span class="line">101</span><br><span class="line">102</span><br><span class="line">103</span><br><span class="line">104</span><br><span class="line">105</span><br><span class="line">106</span><br><span class="line">107</span><br><span class="line">108</span><br><span class="line">109</span><br><span class="line">110</span><br><span class="line">111</span><br><span class="line">112</span><br><span class="line">113</span><br><span class="line">114</span><br><span class="line">115</span><br><span class="line">116</span><br><span class="line">117</span><br><span class="line">118</span><br><span class="line">119</span><br><span class="line">120</span><br><span class="line">121</span><br><span class="line">122</span><br><span class="line">123</span><br><span class="line">124</span><br><span class="line">125</span><br><span class="line">126</span><br><span class="line">127</span><br><span class="line">128</span><br><span class="line">129</span><br><span class="line">130</span><br><span class="line">131</span><br><span class="line">132</span><br><span class="line">133</span><br><span class="line">134</span><br><span class="line">135</span><br><span class="line">136</span><br><span class="line">137</span><br><span class="line">138</span><br><span class="line">139</span><br><span class="line">140</span><br><span class="line">141</span><br><span class="line">142</span><br><span class="line">143</span><br><span class="line">144</span><br><span class="line">145</span><br><span class="line">146</span><br><span class="line">147</span><br><span class="line">148</span><br><span class="line">149</span><br><span class="line">150</span><br><span class="line">151</span><br><span class="line">152</span><br><span class="line">153</span><br><span class="line">154</span><br><span class="line">155</span><br><span class="line">156</span><br><span class="line">157</span><br><span class="line">158</span><br><span class="line">159</span><br><span class="line">160</span><br><span class="line">161</span><br><span class="line">162</span><br><span class="line">163</span><br><span class="line">164</span><br><span class="line">165</span><br><span class="line">166</span><br><span class="line">167</span><br><span class="line">168</span><br><span class="line">169</span><br><span class="line">170</span><br><span class="line">171</span><br><span class="line">172</span><br><span class="line">173</span><br><span class="line">174</span><br><span class="line">175</span><br><span class="line">176</span><br><span class="line">177</span><br><span class="line">178</span><br><span class="line">179</span><br><span class="line">180</span><br><span class="line">181</span><br><span class="line">182</span><br><span class="line">183</span><br><span class="line">184</span><br><span class="line">185</span><br><span class="line">186</span><br><span class="line">187</span><br><span class="line">188</span><br><span class="line">189</span><br><span class="line">190</span><br><span class="line">191</span><br><span class="line">192</span><br><span class="line">193</span><br><span class="line">194</span><br><span class="line">195</span><br><span class="line">196</span><br><span class="line">197</span><br><span class="line">198</span><br><span class="line">199</span><br><span class="line">200</span><br><span class="line">201</span><br><span class="line">202</span><br><span class="line">203</span><br><span class="line">204</span><br><span class="line">205</span><br><span class="line">206</span><br><span class="line">207</span><br><span class="line">208</span><br><span class="line">209</span><br><span class="line">210</span><br><span class="line">211</span><br><span class="line">212</span><br><span class="line">213</span><br><span class="line">214</span><br><span class="line">215</span><br><span class="line">216</span><br><span class="line">217</span><br><span class="line">218</span><br><span class="line">219</span><br><span class="line">220</span><br><span class="line">221</span><br><span class="line">222</span><br><span class="line">223</span><br><span class="line">224</span><br><span class="line">225</span><br><span class="line">226</span><br><span class="line">227</span><br><span class="line">228</span><br><span class="line">229</span><br><span class="line">230</span><br><span class="line">231</span><br><span class="line">232</span><br><span class="line">233</span><br><span class="line">234</span><br><span class="line">235</span><br><span class="line">236</span><br><span class="line">237</span><br><span class="line">238</span><br><span class="line">239</span><br><span class="line">240</span><br><span class="line">241</span><br><span class="line">242</span><br><span class="line">243</span><br><span class="line">244</span><br><span class="line">245</span><br><span class="line">246</span><br><span class="line">247</span><br><span class="line">248</span><br><span class="line">249</span><br><span class="line">250</span><br><span class="line">251</span><br><span class="line">252</span><br><span class="line">253</span><br><span class="line">254</span><br><span class="line">255</span><br><span class="line">256</span><br><span class="line">257</span><br><span class="line">258</span><br><span class="line">259</span><br><span class="line">260</span><br><span class="line">261</span><br><span class="line">262</span><br><span class="line">263</span><br><span class="line">264</span><br><span class="line">265</span><br><span class="line">266</span><br><span class="line">267</span><br><span class="line">268</span><br><span class="line">269</span><br><span class="line">270</span><br><span class="line">271</span><br><span class="line">272</span><br><span class="line">273</span><br><span class="line">274</span><br><span class="line">275</span><br><span class="line">276</span><br><span class="line">277</span><br><span class="line">278</span><br><span class="line">279</span><br><span class="line">280</span><br><span class="line">281</span><br><span class="line">282</span><br><span class="line">283</span><br><span class="line">284</span><br><span class="line">285</span><br><span class="line">286</span><br><span class="line">287</span><br><span class="line">288</span><br><span class="line">289</span><br><span class="line">290</span><br><span class="line">291</span><br><span class="line">292</span><br><span class="line">293</span><br><span class="line">294</span><br><span class="line">295</span><br><span class="line">296</span><br><span class="line">297</span><br><span class="line">298</span><br><span class="line">299</span><br><span class="line">300</span><br><span class="line">301</span><br><span class="line">302</span><br><span class="line">303</span><br><span class="line">304</span><br><span class="line">305</span><br><span class="line">306</span><br><span class="line">307</span><br><span class="line">308</span><br><span class="line">309</span><br><span class="line">310</span><br><span class="line">311</span><br><span class="line">312</span><br><span class="line">313</span><br><span class="line">314</span><br><span class="line">315</span><br><span class="line">316</span><br><span class="line">317</span><br><span class="line">318</span><br><span class="line">319</span><br><span class="line">320</span><br><span class="line">321</span><br><span class="line">322</span><br><span class="line">323</span><br><span class="line">324</span><br><span class="line">325</span><br><span class="line">326</span><br><span class="line">327</span><br><span class="line">328</span><br><span class="line">329</span><br><span class="line">330</span><br><span class="line">331</span><br><span class="line">332</span><br><span class="line">333</span><br><span class="line">334</span><br><span class="line">335</span><br><span class="line">336</span><br><span class="line">337</span><br><span class="line">338</span><br><span class="line">339</span><br><span class="line">340</span><br><span class="line">341</span><br><span class="line">342</span><br><span class="line">343</span><br><span class="line">344</span><br><span class="line">345</span><br><span class="line">346</span><br><span class="line">347</span><br><span class="line">348</span><br><span class="line">349</span><br><span class="line">350</span><br><span class="line">351</span><br><span class="line">352</span><br><span class="line">353</span><br><span class="line">354</span><br><span class="line">355</span><br><span class="line">356</span><br><span class="line">357</span><br><span class="line">358</span><br><span class="line">359</span><br><span class="line">360</span><br><span class="line">361</span><br><span class="line">362</span><br><span class="line">363</span><br><span class="line">364</span><br><span class="line">365</span><br><span class="line">366</span><br><span class="line">367</span><br><span class="line">368</span><br><span class="line">369</span><br><span class="line">370</span><br><span class="line">371</span><br><span class="line">372</span><br><span class="line">373</span><br><span class="line">374</span><br><span class="line">375</span><br><span class="line">376</span><br><span class="line">377</span><br><span class="line">378</span><br><span class="line">379</span><br><span class="line">380</span><br><span class="line">381</span><br><span class="line">382</span><br><span class="line">383</span><br><span class="line">384</span><br><span class="line">385</span><br><span class="line">386</span><br><span class="line">387</span><br><span class="line">388</span><br><span class="line">389</span><br><span class="line">390</span><br><span class="line">391</span><br><span class="line">392</span><br><span class="line">393</span><br><span class="line">394</span><br><span class="line">395</span><br><span class="line">396</span><br><span class="line">397</span><br><span class="line">398</span><br><span class="line">399</span><br><span class="line">400</span><br><span class="line">401</span><br><span class="line">402</span><br><span class="line">403</span><br><span class="line">404</span><br><span class="line">405</span><br><span class="line">406</span><br><span class="line">407</span><br><span class="line">408</span><br><span class="line">409</span><br><span class="line">410</span><br><span class="line">411</span><br><span class="line">412</span><br><span class="line">413</span><br><span class="line">414</span><br><span class="line">415</span><br><span class="line">416</span><br><span class="line">417</span><br><span class="line">418</span><br><span class="line">419</span><br><span class="line">420</span><br><span class="line">421</span><br><span class="line">422</span><br><span class="line">423</span><br><span class="line">424</span><br><span class="line">425</span><br><span class="line">426</span><br><span class="line">427</span><br><span class="line">428</span><br><span class="line">429</span><br><span class="line">430</span><br><span class="line">431</span><br><span class="line">432</span><br><span class="line">433</span><br><span class="line">434</span><br><span class="line">435</span><br><span class="line">436</span><br><span class="line">437</span><br><span class="line">438</span><br><span class="line">439</span><br><span class="line">440</span><br><span class="line">441</span><br><span class="line">442</span><br><span class="line">443</span><br><span class="line">444</span><br><span class="line">445</span><br><span class="line">446</span><br><span class="line">447</span><br><span class="line">448</span><br><span class="line">449</span><br><span class="line">450</span><br><span class="line">451</span><br><span class="line">452</span><br><span class="line">453</span><br><span class="line">454</span><br><span class="line">455</span><br><span class="line">456</span><br><span class="line">457</span><br><span class="line">458</span><br><span class="line">459</span><br><span class="line">460</span><br><span class="line">461</span><br><span class="line">462</span><br><span class="line">463</span><br><span class="line">464</span><br><span class="line">465</span><br><span class="line">466</span><br><span class="line">467</span><br><span class="line">468</span><br><span class="line">469</span><br><span class="line">470</span><br><span class="line">471</span><br><span class="line">472</span><br><span class="line">473</span><br><span class="line">474</span><br><span class="line">475</span><br><span class="line">476</span><br><span class="line">477</span><br><span class="line">478</span><br><span class="line">479</span><br><span class="line">480</span><br><span class="line">481</span><br><span class="line">482</span><br><span class="line">483</span><br><span class="line">484</span><br><span class="line">485</span><br><span class="line">486</span><br><span class="line">487</span><br><span class="line">488</span><br><span class="line">489</span><br><span class="line">490</span><br><span class="line">491</span><br><span class="line">492</span><br><span class="line">493</span><br><span class="line">494</span><br><span class="line">495</span><br><span class="line">496</span><br><span class="line">497</span><br><span class="line">498</span><br><span class="line">499</span><br><span class="line">500</span><br><span class="line">501</span><br><span class="line">502</span><br><span class="line">503</span><br><span class="line">504</span><br><span class="line">505</span><br><span class="line">506</span><br><span class="line">507</span><br><span class="line">508</span><br><span class="line">509</span><br><span class="line">510</span><br><span class="line">511</span><br><span class="line">512</span><br><span class="line">513</span><br><span class="line">514</span><br><span class="line">515</span><br><span class="line">516</span><br><span class="line">517</span><br><span class="line">518</span><br><span class="line">519</span><br><span class="line">520</span><br></pre></td><td class="code"><pre><span class="line"># 当配置中需要配置内存大小时，可以使用 1k, 5GB, 4M 等类似的格式，其转换方式如下(不区分大小写)</span><br><span class="line">#</span><br><span class="line"># 1k =&gt;</span><br><span class="line">1000 bytes</span><br><span class="line"># 1kb =&gt; 1024 bytes</span><br><span class="line"># 1m =&gt; 1000000 bytes</span><br><span class="line"># 1mb =&gt;</span><br><span class="line">1024*1024 bytes</span><br><span class="line"># 1g =&gt; 1000000000 bytes</span><br><span class="line"># 1gb =&gt; 1024*1024*1024</span><br><span class="line">bytes</span><br><span class="line">#</span><br><span class="line"># 内存配置大小写是一样的.比如 1gb 1Gb 1GB 1gB</span><br><span class="line"></span><br><span class="line"># daemonize no 默认情况下，redis不是在后台运行的，如果需要在后台运行，把该项的值更改为yes</span><br><span class="line">daemonize</span><br><span class="line">yes</span><br><span class="line"></span><br><span class="line"># 当redis在后台运行的时候，Redis默认会把pid文件放在/var/run/redis.pid，你可以配置到其他地址。</span><br><span class="line">#</span><br><span class="line">当运行多个redis服务时，需要指定不同的pid文件和端口</span><br><span class="line">pidfile /var/run/redis.pid</span><br><span class="line"></span><br><span class="line"># 指定redis运行的端口，默认是6379</span><br><span class="line">port 6379</span><br><span class="line"></span><br><span class="line"># 指定redis只接收来自于该IP地址的请求，如果不进行设置，那么将处理所有请求，</span><br><span class="line"># 在生产环境中最好设置该项</span><br><span class="line"># bind</span><br><span class="line"><span class="number">127.0</span><span class="number">.0</span><span class="number">.1</span></span><br><span class="line"></span><br><span class="line"># Specify the path for the unix socket that will be used to listen for</span><br><span class="line">#</span><br><span class="line">incoming connections. There is no default, so Redis will not listen</span><br><span class="line"># on a</span><br><span class="line">unix socket when not specified.</span><br><span class="line">#</span><br><span class="line"># unixsocket /tmp/redis.sock</span><br><span class="line">#</span><br><span class="line">unixsocketperm 755</span><br><span class="line"></span><br><span class="line"># 设置客户端连接时的超时时间，单位为秒。当客户端在这段时间内没有发出任何指令，那么关闭该连接</span><br><span class="line"># 0是关闭此设置</span><br><span class="line">timeout</span><br><span class="line"><span class="number">0</span></span><br><span class="line"></span><br><span class="line"># 指定日志记录级别</span><br><span class="line"># Redis总共支持四个级别：debug、verbose、notice、warning，默认为verbose</span><br><span class="line">#</span><br><span class="line">debug  记录很多信息，用于开发和测试</span><br><span class="line"># varbose 有用的信息，不像debug会记录那么多</span><br><span class="line">#</span><br><span class="line">notice 普通的verbose，常用于生产环境</span><br><span class="line"># warning 只有非常重要或者严重的信息会记录到日志</span><br><span class="line">loglevel</span><br><span class="line">debug</span><br><span class="line"></span><br><span class="line"># 配置log文件地址</span><br><span class="line"># 默认值为stdout，标准输出，若后台模式会输出到/dev/null</span><br><span class="line">#logfile</span><br><span class="line">stdout</span><br><span class="line">logfile /var/log/redis/redis.log</span><br><span class="line"></span><br><span class="line"># To enable logging to the system logger, just set 'syslog-enabled' to</span><br><span class="line">yes,</span><br><span class="line"># and optionally update the other syslog parameters to suit your</span><br><span class="line">needs.</span><br><span class="line"># syslog-enabled no</span><br><span class="line"></span><br><span class="line"># Specify the syslog identity.</span><br><span class="line"># syslog-ident redis</span><br><span class="line"></span><br><span class="line"># Specify the syslog facility.  Must be USER or between LOCAL0-LOCAL7.</span><br><span class="line">#</span><br><span class="line">syslog-facility local0</span><br><span class="line"></span><br><span class="line"># 可用数据库数</span><br><span class="line"># 默认值为16，默认数据库为0，数据库范围在0-（database-1）之间</span><br><span class="line">databases 16</span><br><span class="line"></span><br><span class="line">################################ 快照  </span><br><span class="line">#################################</span><br><span class="line">#</span><br><span class="line"># 保存数据到磁盘，格式如下:</span><br><span class="line">#</span><br><span class="line">#   save</span><br><span class="line">&lt;seconds&gt; &lt;changes&gt;</span><br><span class="line">#</span><br><span class="line">#   </span><br><span class="line">指出在多长时间内，有多少次更新操作，就将数据同步到数据文件rdb。</span><br><span class="line">#   相当于条件触发抓取快照，这个可以多个条件配合</span><br><span class="line">#   </span><br><span class="line">#   </span><br><span class="line">比如默认配置文件中的设置，就设置了三个条件</span><br><span class="line">#</span><br><span class="line">#   save 900 1  900秒内至少有1个key被改变</span><br><span class="line">#   save 300</span><br><span class="line">10  300秒内至少有300个key被改变</span><br><span class="line">#   save 60 10000  60秒内至少有10000个key被改变</span><br><span class="line"></span><br><span class="line">save 900 1</span><br><span class="line">save 300 10</span><br><span class="line">save 60 10000</span><br><span class="line"></span><br><span class="line"># 存储至本地数据库时（持久化到rdb文件）是否压缩数据，默认为yes</span><br><span class="line">rdbcompression yes</span><br><span class="line"></span><br><span class="line"># 本地持久化数据库文件名，默认值为dump.rdb</span><br><span class="line">dbfilename dump.rdb</span><br><span class="line"></span><br><span class="line"># 工作目录</span><br><span class="line">#</span><br><span class="line"># 数据库镜像备份的文件放置的路径。</span><br><span class="line">#</span><br><span class="line">这里的路径跟文件名要分开配置是因为redis在进行备份时，先会将当前数据库的状态写入到一个临时文件中，等备份完成时，</span><br><span class="line">#</span><br><span class="line">再把该该临时文件替换为上面所指定的文件，而这里的临时文件和上面所配置的备份文件都会放在这个指定的路径当中。</span><br><span class="line">#</span><br><span class="line">#</span><br><span class="line">AOF文件也会存放在这个目录下面</span><br><span class="line">#</span><br><span class="line"># 注意这里必须制定一个目录而不是文件</span><br><span class="line">dir ./</span><br><span class="line"></span><br><span class="line">################################# 复制</span><br><span class="line">#################################</span><br><span class="line"></span><br><span class="line"># 主从复制. 设置该数据库为其他数据库的从数据库.</span><br><span class="line">#</span><br><span class="line">设置当本机为slav服务时，设置master服务的IP地址及端口，在Redis启动时，它会自动从master进行数据同步</span><br><span class="line">#</span><br><span class="line"># slaveof</span><br><span class="line">&lt;masterip&gt; &lt;masterport&gt;</span><br><span class="line"></span><br><span class="line"># 当master服务设置了密码保护时(用requirepass制定的密码)</span><br><span class="line"># slav服务连接master的密码</span><br><span class="line">#</span><br><span class="line">#</span><br><span class="line">masterauth &lt;master-password&gt;</span><br><span class="line"></span><br><span class="line"></span><br><span class="line"># 当从库同主机失去连接或者复制正在进行，从机库有两种运行方式：</span><br><span class="line">#</span><br><span class="line"># 1)</span><br><span class="line">如果slave-serve-stale-data设置为yes(默认设置)，从库会继续相应客户端的请求</span><br><span class="line">#</span><br><span class="line"># 2)</span><br><span class="line">如果slave-serve-stale-data是指为no，出去INFO和SLAVOF命令之外的任何请求都会返回一个</span><br><span class="line">#    错误"SYNC with</span><br><span class="line">master in progress"</span><br><span class="line">#</span><br><span class="line">slave-serve-stale-data yes</span><br><span class="line"></span><br><span class="line"># 从库会按照一个时间间隔向主库发送PINGs.可以通过repl-ping-slave-period设置这个时间间隔，默认是10秒</span><br><span class="line">#</span><br><span class="line">#</span><br><span class="line">repl-ping-slave-period 10</span><br><span class="line"></span><br><span class="line"># repl-timeout 设置主库批量数据传输时间或者ping回复时间间隔，默认值是60秒</span><br><span class="line">#</span><br><span class="line">一定要确保repl-timeout大于repl-ping-slave-period</span><br><span class="line"># repl-timeout 60</span><br><span class="line"></span><br><span class="line">################################## 安全</span><br><span class="line">###################################</span><br><span class="line"></span><br><span class="line"># 设置客户端连接后进行任何其他指定前需要使用的密码。</span><br><span class="line">#</span><br><span class="line">警告：因为redis速度相当快，所以在一台比较好的服务器下，一个外部的用户可以在一秒钟进行150K次的密码尝试，这意味着你需要指定非常非常强大的密码来防止暴力破解</span><br><span class="line">#</span><br><span class="line">#</span><br><span class="line">requirepass foobared</span><br><span class="line"></span><br><span class="line"># 命令重命名.</span><br><span class="line">#</span><br><span class="line"># 在一个共享环境下可以重命名相对危险的命令。比如把CONFIG重名为一个不容易猜测的字符。</span><br><span class="line">#</span><br><span class="line">#</span><br><span class="line">举例:</span><br><span class="line">#</span><br><span class="line"># rename-command CONFIG</span><br><span class="line">b840fc02d524045429941cc15f59e41cb7be6c52</span><br><span class="line">#</span><br><span class="line">#</span><br><span class="line">如果想删除一个命令，直接把它重命名为一个空字符""即可，如下：</span><br><span class="line">#</span><br><span class="line"># rename-command CONFIG ""</span><br><span class="line"></span><br><span class="line">################################### 约束</span><br><span class="line">####################################</span><br><span class="line"></span><br><span class="line"># 设置同一时间最大客户端连接数，默认无限制，Redis可以同时打开的客户端连接数为Redis进程可以打开的最大文件描述符数，</span><br><span class="line"># 如果设置</span><br><span class="line">maxclients 0，表示不作限制。</span><br><span class="line"># 当客户端连接数到达限制时，Redis会关闭新的连接并向客户端返回max number of clients</span><br><span class="line">reached错误信息</span><br><span class="line">#</span><br><span class="line"># maxclients 128</span><br><span class="line"></span><br><span class="line"># 指定Redis最大内存限制，Redis在启动时会把数据加载到内存中，达到最大内存后，Redis会先尝试清除已到期或即将到期的Key</span><br><span class="line">#</span><br><span class="line">Redis同时也会移除空的list对象</span><br><span class="line">#</span><br><span class="line">#</span><br><span class="line">当此方法处理后，仍然到达最大内存设置，将无法再进行写入操作，但仍然可以进行读取操作</span><br><span class="line">#</span><br><span class="line">#</span><br><span class="line">注意：Redis新的vm机制，会把Key存放内存，Value会存放在swap区</span><br><span class="line">#</span><br><span class="line">#</span><br><span class="line">maxmemory的设置比较适合于把redis当作于类似memcached的缓存来使用，而不适合当做一个真实的DB。</span><br><span class="line">#</span><br><span class="line">当把Redis当做一个真实的数据库使用的时候，内存使用将是一个很大的开销</span><br><span class="line"># maxmemory &lt;bytes&gt;</span><br><span class="line"></span><br><span class="line"># 当内存达到最大值的时候Redis会选择删除哪些数据？有五种方式可供选择</span><br><span class="line">#</span><br><span class="line"># volatile-lru -&gt;</span><br><span class="line">利用LRU算法移除设置过过期时间的key (LRU:最近使用 Least Recently Used )</span><br><span class="line"># allkeys-lru -&gt;</span><br><span class="line">利用LRU算法移除任何key</span><br><span class="line"># volatile-random -&gt; 移除设置过过期时间的随机key</span><br><span class="line">#</span><br><span class="line">allkeys-&gt;random -&gt; remove a random key, any key</span><br><span class="line"># volatile-ttl -&gt;</span><br><span class="line">移除即将过期的key(minor TTL)</span><br><span class="line"># noeviction -&gt; 不移除任何可以，只是返回一个写错误</span><br><span class="line">#</span><br><span class="line">#</span><br><span class="line">注意：对于上面的策略，如果没有合适的key可以移除，当写的时候Redis会返回一个错误</span><br><span class="line">#</span><br><span class="line">#       写命令包括: set setnx</span><br><span class="line">setex append</span><br><span class="line">#       incr decr rpush lpush rpushx lpushx linsert lset</span><br><span class="line">rpoplpush sadd</span><br><span class="line">#       sinter sinterstore sunion sunionstore sdiff sdiffstore</span><br><span class="line">zadd zincrby</span><br><span class="line">#       zunionstore zinterstore hset hsetnx hmset hincrby incrby</span><br><span class="line">decrby</span><br><span class="line">#       getset mset msetnx exec sort</span><br><span class="line">#</span><br><span class="line"># 默认是:</span><br><span class="line">#</span><br><span class="line">#</span><br><span class="line">maxmemory-policy volatile-lru</span><br><span class="line"></span><br><span class="line"># LRU 和 minimal TTL 算法都不是精准的算法，但是相对精确的算法(为了节省内存)，随意你可以选择样本大小进行检测。</span><br><span class="line">#</span><br><span class="line">Redis默认的灰选择3个样本进行检测，你可以通过maxmemory-samples进行设置</span><br><span class="line">#</span><br><span class="line"># maxmemory-samples</span><br><span class="line"><span class="number">3</span></span><br><span class="line"></span><br><span class="line">############################## AOF ###############################</span><br><span class="line"></span><br><span class="line"></span><br><span class="line">#</span><br><span class="line">默认情况下，redis会在后台异步的把数据库镜像备份到磁盘，但是该备份是非常耗时的，而且备份也不能很频繁，如果发生诸如拉闸限电、拔插头等状况，那么将造成比较大范围的数据丢失。</span><br><span class="line">#</span><br><span class="line">所以redis提供了另外一种更加高效的数据库备份及灾难恢复方式。</span><br><span class="line"># 开启append</span><br><span class="line">only模式之后，redis会把所接收到的每一次写操作请求都追加到appendonly.aof文件中，当redis重新启动时，会从该文件恢复出之前的状态。</span><br><span class="line">#</span><br><span class="line">但是这样会造成appendonly.aof文件过大，所以redis还支持了BGREWRITEAOF指令，对appendonly.aof 进行重新整理。</span><br><span class="line">#</span><br><span class="line">你可以同时开启asynchronous dumps 和 AOF</span><br><span class="line"></span><br><span class="line">appendonly no</span><br><span class="line"></span><br><span class="line"># AOF文件名称 (默认: "appendonly.aof")</span><br><span class="line"># appendfilename appendonly.aof</span><br><span class="line"></span><br><span class="line"># Redis支持三种同步AOF文件的策略:</span><br><span class="line">#</span><br><span class="line"># no: 不进行同步，系统去操作 . Faster.</span><br><span class="line"># always:</span><br><span class="line">always表示每次有写操作都进行同步. Slow, Safest.</span><br><span class="line"># everysec: 表示对写操作进行累积，每秒同步一次.</span><br><span class="line">Compromise.</span><br><span class="line">#</span><br><span class="line"># 默认是"everysec"，按照速度和安全折中这是最好的。</span><br><span class="line">#</span><br><span class="line">如果想让Redis能更高效的运行，你也可以设置为"no"，让操作系统决定什么时候去执行</span><br><span class="line">#</span><br><span class="line">或者相反想让数据更安全你也可以设置为"always"</span><br><span class="line">#</span><br><span class="line"># 如果不确定就用 "everysec".</span><br><span class="line"></span><br><span class="line"># appendfsync always</span><br><span class="line">appendfsync everysec</span><br><span class="line"># appendfsync no</span><br><span class="line"></span><br><span class="line"># AOF策略设置为always或者everysec时，后台处理进程(后台保存或者AOF日志重写)会执行大量的I/O操作</span><br><span class="line">#</span><br><span class="line">在某些Linux配置中会阻止过长的fsync()请求。注意现在没有任何修复，即使fsync在另外一个线程进行处理</span><br><span class="line">#</span><br><span class="line">#</span><br><span class="line">为了减缓这个问题，可以设置下面这个参数no-appendfsync-on-rewrite</span><br><span class="line">#</span><br><span class="line"># This means that while</span><br><span class="line">another child is saving the durability of Redis is</span><br><span class="line"># the same as "appendfsync</span><br><span class="line">none", that in pratical terms means that it is</span><br><span class="line"># possible to lost up to 30</span><br><span class="line">seconds of log in the worst scenario (with the</span><br><span class="line"># default Linux</span><br><span class="line">settings).</span><br><span class="line">#</span><br><span class="line"># If you have latency problems turn this to "yes". Otherwise</span><br><span class="line">leave it as</span><br><span class="line"># "no" that is the safest pick from the point of view of</span><br><span class="line">durability.</span><br><span class="line">no-appendfsync-on-rewrite no</span><br><span class="line"></span><br><span class="line"># Automatic rewrite of the append only file.</span><br><span class="line"># AOF 自动重写</span><br><span class="line">#</span><br><span class="line">当AOF文件增长到一定大小的时候Redis能够调用 BGREWRITEAOF 对日志文件进行重写</span><br><span class="line">#</span><br><span class="line">#</span><br><span class="line">它是这样工作的：Redis会记住上次进行些日志后文件的大小(如果从开机以来还没进行过重写，那日子大小在开机的时候确定)</span><br><span class="line">#</span><br><span class="line">#</span><br><span class="line">基础大小会同现在的大小进行比较。如果现在的大小比基础大小大制定的百分比，重写功能将启动</span><br><span class="line">#</span><br><span class="line">同时需要指定一个最小大小用于AOF重写，这个用于阻止即使文件很小但是增长幅度很大也去重写AOF文件的情况</span><br><span class="line"># 设置 percentage</span><br><span class="line">为0就关闭这个特性</span><br><span class="line"></span><br><span class="line">auto-aof-rewrite-percentage 100</span><br><span class="line">auto-aof-rewrite-min-size 64mb</span><br><span class="line"></span><br><span class="line">################################## SLOW LOG</span><br><span class="line">###################################</span><br><span class="line"></span><br><span class="line"># Redis Slow Log 记录超过特定执行时间的命令。执行时间不包括I/O计算比如连接客户端，返回结果等，只是命令执行时间</span><br><span class="line">#</span><br><span class="line">#</span><br><span class="line">可以通过两个参数设置slow log：一个是告诉Redis执行超过多少时间被记录的参数slowlog-log-slower-than(微妙)，</span><br><span class="line">#</span><br><span class="line">另一个是slow log 的长度。当一个新命令被记录的时候最早的命令将被从队列中移除</span><br><span class="line"></span><br><span class="line"># 下面的时间以微妙微单位，因此1000000代表一分钟。</span><br><span class="line">#</span><br><span class="line">注意制定一个负数将关闭慢日志，而设置为0将强制每个命令都会记录</span><br><span class="line">slowlog-log-slower-than 10000</span><br><span class="line"></span><br><span class="line"># 对日志长度没有限制，只是要注意它会消耗内存</span><br><span class="line"># 可以通过 SLOWLOG RESET</span><br><span class="line">回收被慢日志消耗的内存</span><br><span class="line">slowlog-max-len 1024</span><br><span class="line"></span><br><span class="line">################################ VM ###############################</span><br><span class="line"></span><br><span class="line">### WARNING! Virtual Memory is deprecated in Redis 2.4</span><br><span class="line">### The use of</span><br><span class="line">Virtual Memory is strongly discouraged.</span><br><span class="line"></span><br><span class="line"># Virtual Memory allows Redis to work with datasets bigger than the</span><br><span class="line">actual</span><br><span class="line"># amount of RAM needed to hold the whole dataset in memory.</span><br><span class="line"># In</span><br><span class="line">order to do so very used keys are taken in memory while the other keys</span><br><span class="line"># are</span><br><span class="line">swapped into a swap file, similarly to what operating systems do</span><br><span class="line"># with</span><br><span class="line">memory pages.</span><br><span class="line">#</span><br><span class="line"># To enable VM just set 'vm-enabled' to yes, and set the</span><br><span class="line">following three</span><br><span class="line"># VM parameters accordingly to your needs.</span><br><span class="line"></span><br><span class="line">vm-enabled no</span><br><span class="line"># vm-enabled yes</span><br><span class="line"></span><br><span class="line"># This is the path of the Redis swap file. As you can guess, swap</span><br><span class="line">files</span><br><span class="line"># can't be shared by different Redis instances, so make sure to use a</span><br><span class="line">swap</span><br><span class="line"># file for every redis process you are running. Redis will complain if</span><br><span class="line">the</span><br><span class="line"># swap file is already in use.</span><br><span class="line">#</span><br><span class="line"># The best kind of storage for the</span><br><span class="line">Redis swap file (that's accessed at random)</span><br><span class="line"># is a Solid State Disk</span><br><span class="line">(SSD).</span><br><span class="line">#</span><br><span class="line"># *** WARNING *** if you are using a shared hosting the default</span><br><span class="line">of putting</span><br><span class="line"># the swap file under /tmp is not secure. Create a dir with access</span><br><span class="line">granted</span><br><span class="line"># only to Redis user and configure Redis to create the swap file</span><br><span class="line">there.</span><br><span class="line">vm-swap-file /tmp/redis.swap</span><br><span class="line"></span><br><span class="line"># vm-max-memory configures the VM to use at max the specified amount</span><br><span class="line">of</span><br><span class="line"># RAM. Everything that deos not fit will be swapped on disk *if* possible,</span><br><span class="line">that</span><br><span class="line"># is, if there is still enough contiguous space in the swap</span><br><span class="line">file.</span><br><span class="line">#</span><br><span class="line"># With vm-max-memory 0 the system will swap everything it can. Not</span><br><span class="line">a good</span><br><span class="line"># default, just specify the max amount of RAM you can in bytes, but</span><br><span class="line">it's</span><br><span class="line"># better to leave some margin. For instance specify an amount of</span><br><span class="line">RAM</span><br><span class="line"># that's more or less between 60 and 80% of your free</span><br><span class="line">RAM.</span><br><span class="line">vm-max-memory 0</span><br><span class="line"></span><br><span class="line"># Redis swap files is split into pages. An object can be saved using</span><br><span class="line">multiple</span><br><span class="line"># contiguous pages, but pages can't be shared between different</span><br><span class="line">objects.</span><br><span class="line"># So if your page is too big, small objects swapped out on disk will</span><br><span class="line">waste</span><br><span class="line"># a lot of space. If you page is too small, there is less space in the</span><br><span class="line">swap</span><br><span class="line"># file (assuming you configured the same number of total swap file</span><br><span class="line">pages).</span><br><span class="line">#</span><br><span class="line"># If you use a lot of small objects, use a page size of 64 or 32</span><br><span class="line">bytes.</span><br><span class="line"># If you use a lot of big objects, use a bigger page size.</span><br><span class="line"># If</span><br><span class="line">unsure, use the default :)</span><br><span class="line">vm-page-size 32</span><br><span class="line"></span><br><span class="line"># Number of total memory pages in the swap file.</span><br><span class="line"># Given that the page</span><br><span class="line">table (a bitmap of free/used pages) is taken in memory,</span><br><span class="line"># every 8 pages on</span><br><span class="line">disk will consume 1 byte of RAM.</span><br><span class="line">#</span><br><span class="line"># The total swap size is vm-page-size *</span><br><span class="line">vm-pages</span><br><span class="line">#</span><br><span class="line"># With the default of 32-bytes memory pages and 134217728 pages</span><br><span class="line">Redis will</span><br><span class="line"># use a 4 GB swap file, that will use 16 MB of RAM for the page</span><br><span class="line">table.</span><br><span class="line">#</span><br><span class="line"># It's better to use the smallest acceptable value for your</span><br><span class="line">application,</span><br><span class="line"># but the default is large in order to work in most</span><br><span class="line">conditions.</span><br><span class="line">vm-pages 134217728</span><br><span class="line"></span><br><span class="line"># Max number of VM I/O threads running at the same time.</span><br><span class="line"># This threads</span><br><span class="line">are used to read/write data from/to swap file, since they</span><br><span class="line"># also encode and</span><br><span class="line">decode objects from disk to memory or the reverse, a bigger</span><br><span class="line"># number of</span><br><span class="line">threads can help with big objects even if they can't help with</span><br><span class="line"># I/O itself</span><br><span class="line">as the physical device may not be able to couple with many</span><br><span class="line"># reads/writes</span><br><span class="line">operations at the same time.</span><br><span class="line">#</span><br><span class="line"># The special value of 0 turn off threaded</span><br><span class="line">I/O and enables the blocking</span><br><span class="line"># Virtual Memory</span><br><span class="line">implementation.</span><br><span class="line">vm-max-threads 4</span><br><span class="line"></span><br><span class="line">############################### ADVANCED CONFIG</span><br><span class="line">###############################</span><br><span class="line"></span><br><span class="line"># 当hash中包含超过指定元素个数并且最大的元素没有超过临界时，</span><br><span class="line">#</span><br><span class="line">hash将以一种特殊的编码方式（大大减少内存使用）来存储，这里可以设置这两个临界值</span><br><span class="line"># Redis</span><br><span class="line">Hash对应Value内部实际就是一个HashMap，实际这里会有2种不同实现，</span><br><span class="line">#</span><br><span class="line">这个Hash的成员比较少时Redis为了节省内存会采用类似一维数组的方式来紧凑存储，而不会采用真正的HashMap结构，对应的value</span><br><span class="line">redisObject的encoding为zipmap,</span><br><span class="line">#</span><br><span class="line">当成员数量增大时会自动转成真正的HashMap,此时encoding为ht。</span><br><span class="line">hash-max-zipmap-entries</span><br><span class="line"><span class="number">512</span></span><br><span class="line">hash-max-zipmap-value 64</span><br><span class="line"></span><br><span class="line"># list数据类型多少节点以下会采用去指针的紧凑存储格式。</span><br><span class="line">#</span><br><span class="line">list数据类型节点值大小小于多少字节会采用紧凑存储格式。</span><br><span class="line">list-max-ziplist-entries</span><br><span class="line"><span class="number">512</span></span><br><span class="line">list-max-ziplist-value 64</span><br><span class="line"></span><br><span class="line"># set数据类型内部数据如果全部是数值型，且包含多少节点以下会采用紧凑格式存储。</span><br><span class="line">set-max-intset-entries</span><br><span class="line"><span class="number">512</span></span><br><span class="line"></span><br><span class="line"># zsort数据类型多少节点以下会采用去指针的紧凑存储格式。</span><br><span class="line">#</span><br><span class="line">zsort数据类型节点值大小小于多少字节会采用紧凑存储格式。</span><br><span class="line">zset-max-ziplist-entries</span><br><span class="line"><span class="number">128</span></span><br><span class="line">zset-max-ziplist-value 64</span><br><span class="line"></span><br><span class="line"># Redis将在每100毫秒时使用1毫秒的CPU时间来对redis的hash表进行重新hash，可以降低内存的使用</span><br><span class="line">#</span><br><span class="line">#</span><br><span class="line">当你的使用场景中，有非常严格的实时性需要，不能够接受Redis时不时的对请求有2毫秒的延迟的话，把这项配置为no。</span><br><span class="line">#</span><br><span class="line">#</span><br><span class="line">如果没有这么严格的实时性要求，可以设置为yes，以便能够尽可能快的释放内存</span><br><span class="line">activerehashing yes</span><br><span class="line"></span><br><span class="line">################################## INCLUDES</span><br><span class="line">###################################</span><br><span class="line"></span><br><span class="line"># 指定包含其它的配置文件，可以在同一主机上多个Redis实例之间使用同一份配置文件，而同时各个实例又拥有自己的特定配置文件</span><br><span class="line">#</span><br><span class="line">include /path/to/local.conf</span><br><span class="line"># include /path/to/other.conf</span><br></pre></td></tr></table></figure>

      
    </div>
    
  </div>
  
    
    <div class="copyright">
        <p><span>本文标题:</span><a href="/maoge-blog/2018/02/05/花神(maoge)/3.缓存-中间件/Redis 配置文件说明/">Redis集群搭建-配置文件</a></p>
        <p><span>文章作者:</span><a href="/" title="回到主页">zhengweiMao</a></p>
        <p><span>发布时间:</span>2018-02-05, 02:03:22</p>
        <p><span>最后更新:</span>2018-08-05, 20:52:07</p>
        <p>
            <span>原始链接:</span><a class="post-url" href="/maoge-blog/2018/02/05/花神(maoge)/3.缓存-中间件/Redis 配置文件说明/" title="Redis集群搭建-配置文件">https://maozw.gitee.io/maoge-blog/2018/02/05/花神(maoge)/3.缓存-中间件/Redis 配置文件说明/</a>
            <span class="copy-path" data-clipboard-text="原文: https://maozw.gitee.io/maoge-blog/2018/02/05/花神(maoge)/3.缓存-中间件/Redis 配置文件说明/　　作者: zhengweiMao" title="点击复制文章链接"><i class="fa fa-clipboard"></i></span>
            <script> var clipboard = new Clipboard('.copy-path'); </script>
        </p>
        <p>
            <span>许可协议:</span><i class="fa fa-creative-commons"></i> <a rel="license" href="http://creativecommons.org/licenses/by-nc-sa/4.0/" title="CC BY-NC-SA 4.0 International" target = "_blank">"署名-非商用-相同方式共享 4.0"</a> 转载请保留原文链接及作者。
        </p>
    </div>



    <nav id="article-nav">
        
            <div id="article-nav-newer" class="article-nav-title">
                <a href="/maoge-blog/2018/02/05/花神(maoge)/4.JVM相关/1.jvm虚拟机组成部分/">
                    1.jvm虚拟机组成部分
                </a>
            </div>
        
        
            <div id="article-nav-older" class="article-nav-title">
                <a href="/maoge-blog/2018/02/05/花神(maoge)/3.缓存-中间件/Redis----集群搭建/">
                    Redis集群搭建-实践
                </a>
            </div>
        
    </nav>

  
</article>

    <div id="toc" class="toc-article">
        <strong class="toc-title">文章目录</strong>
        
            <ol class="toc"><li class="toc-item toc-level-3"><a class="toc-link" href="#Redis集群搭建"><span class="toc-number">1.</span> <span class="toc-text">Redis集群搭建</span></a><ol class="toc-child"><li class="toc-item toc-level-4"><a class="toc-link" href="#Redis简介"><span class="toc-number">1.1.</span> <span class="toc-text">Redis简介</span></a></li></ol></li></ol></li></ol></li><li class="toc-item toc-level-1"><a class="toc-link" href="#Redis-配置文件"><span class="toc-number"></span> <span class="toc-text">Redis 配置文件</span></a>
        
    </div>
    <style>
        .left-col .switch-btn,
        .left-col .switch-area {
            display: none;
        }
        .toc-level-3 i,
        .toc-level-3 ol {
            display: none !important;
        }
    </style>

    <input type="button" id="tocButton" value="隐藏目录"  title="点击按钮隐藏或者显示文章目录">

    <script>
        yiliaConfig.toc = ["隐藏目录", "显示目录", !!"false"];
    </script>



    
<div class="share">
    
        <div class="bdsharebuttonbox">
            <a href="#" class="fa fa-twitter bds_twi" data-cmd="twi" title="分享到推特"></a>
            <a href="#" class="fa fa-weibo bds_tsina" data-cmd="tsina" title="分享到新浪微博"></a>
            <a href="#" class="fa fa-qq bds_sqq" data-cmd="sqq" title="分享给 QQ 好友"></a>
            <a href="#" class="fa fa-files-o bds_copy" data-cmd="copy" title="复制网址"></a>
            <a href="#" class="fa fa fa-envelope-o bds_mail" data-cmd="mail" title="通过邮件分享"></a>
            <a href="#" class="fa fa-weixin bds_weixin" data-cmd="weixin" title="生成文章二维码"></a>
            <a href="#" class="fa fa-share-alt bds_more" data-cmd="more"></i></a>
        </div>
        <script>
            window._bd_share_config={
                "common":{"bdSnsKey":{},"bdText":"Redis集群搭建-配置文件　| 花神　","bdMini":"2","bdMiniList":false,"bdPic":"","bdStyle":"0","bdSize":"24"},"share":{}};with(document)0[(getElementsByTagName('head')[0]||body).appendChild(createElement('script')).src='http://bdimg.share.baidu.com/static/api/js/share.js?v=89860593.js?cdnversion='+~(-new Date()/36e5)];
        </script>
    

    
</div>







    




    <div class="scroll" id="post-nav-button">
        
            <a href="/maoge-blog/2018/02/05/花神(maoge)/4.JVM相关/1.jvm虚拟机组成部分/" title="上一篇: 1.jvm虚拟机组成部分">
                <i class="fa fa-angle-left"></i>
            </a>
        

        <a title="文章列表"><i class="fa fa-bars"></i><i class="fa fa-times"></i></a>

        
            <a href="/maoge-blog/2018/02/05/花神(maoge)/3.缓存-中间件/Redis----集群搭建/" title="下一篇: Redis集群搭建-实践">
                <i class="fa fa-angle-right"></i>
            </a>
        
    </div>

    <ul class="post-list"><li class="post-list-item"><a class="post-list-link" href="/maoge-blog/2018/08/05/花神(maoge)/9.Spring/SpringBoot/SpringBoot-启动源码解析/">1.SpringBoot源码分析之SpringBoot的启动过程</a></li><li class="post-list-item"><a class="post-list-link" href="/maoge-blog/2018/08/05/花神(maoge)/11.java-reflections/2.反射框架--reflections-抓取实例/">1.反射框架--reflections-抓取实例</a></li><li class="post-list-item"><a class="post-list-link" href="/maoge-blog/2018/08/05/花神(maoge)/11.服务器相关/1.服务器--Sigar 获取CPU和Memory内存等信息使用详解/">1.Sigar 获取CPU和Memory内存等信息使用详解</a></li><li class="post-list-item"><a class="post-list-link" href="/maoge-blog/2018/08/05/花神(maoge)/11.java-reflections/1.反射框架--reflections-基本介绍/">1.反射框架--reflections-基本介绍</a></li><li class="post-list-item"><a class="post-list-link" href="/maoge-blog/2018/08/05/花神(maoge)/10.算法/算法----外部排序/">2.算法 -外部排序</a></li><li class="post-list-item"><a class="post-list-link" href="/maoge-blog/2018/08/05/花神(maoge)/10.算法/算法----snowflake/">1.算法 -snowflake</a></li><li class="post-list-item"><a class="post-list-link" href="/maoge-blog/2018/08/05/花神(maoge)/8.面试/面试/">1.面试</a></li><li class="post-list-item"><a class="post-list-link" href="/maoge-blog/2018/08/01/花神(maoge)/6.quartz--定时任务框架/7.Quartz-Job状态与并发/">7.任务调度框架Quartz-Job状态与并发</a></li><li class="post-list-item"><a class="post-list-link" href="/maoge-blog/2018/08/01/花神(maoge)/6.quartz--定时任务框架/6.任务调度框架Quartz-config/">5.任务调度框架Quartz-Quartz-Job Stores</a></li><li class="post-list-item"><a class="post-list-link" href="/maoge-blog/2018/08/01/花神(maoge)/6.quartz--定时任务框架/5.任务调度框架Quartz-Job Stores/">5.任务调度框架Quartz-Quartz-Job Stores</a></li><li class="post-list-item"><a class="post-list-link" href="/maoge-blog/2018/08/01/花神(maoge)/6.quartz--定时任务框架/4.任务调度框架Quartz-SchedulerListeners/">4.任务调度框架Quartz-SchedulerListeners</a></li><li class="post-list-item"><a class="post-list-link" href="/maoge-blog/2018/08/01/花神(maoge)/6.quartz--定时任务框架/3.任务调度框架Quartz-TriggerListeners和JobListeners/">3.任务调度框架Quartz-Triggers-SimpleTrigger</a></li><li class="post-list-item"><a class="post-list-link" href="/maoge-blog/2018/08/01/花神(maoge)/6.quartz--定时任务框架/2-3.任务调度框架Quartz-Triggers-CronTrigger/">2-2.任务调度框架Quartz-Triggers-CronTrigger</a></li><li class="post-list-item"><a class="post-list-link" href="/maoge-blog/2018/08/01/花神(maoge)/6.quartz--定时任务框架/2-2.任务调度框架Quartz-Triggers-SimpleTrigger/">2-2.任务调度框架Quartz-Triggers-SimpleTrigger</a></li><li class="post-list-item"><a class="post-list-link" href="/maoge-blog/2018/08/01/花神(maoge)/6.quartz--定时任务框架/2-1.任务调度框架Quartz-Triggers详解理解/">2-1.任务调度框Quartz-Triggers详解理解</a></li><li class="post-list-item"><a class="post-list-link" href="/maoge-blog/2018/08/01/花神(maoge)/6.quartz--定时任务框架/1.任务调度框架Quartz-入门/">1.任务调度框架Quartz-入门</a></li><li class="post-list-item"><a class="post-list-link" href="/maoge-blog/2018/07/12/花神(maoge)/9.Spring/SpringMVC--源码解读/05.SpringMVC-----源码分析与实践--HandlerMapping(1)/">1.SpringMVC -源码分析与实践-HandlerMapping</a></li><li class="post-list-item"><a class="post-list-link" href="/maoge-blog/2018/07/12/花神(maoge)/9.Spring/SpringMVC--源码解读/04.SpringMVC-----源码分析与实践--DispatcherServlet核心/">4.SpringMVC -源码分析与实践-DispatcherServlet</a></li><li class="post-list-item"><a class="post-list-link" href="/maoge-blog/2018/07/12/花神(maoge)/9.Spring/SpringMVC--源码解读/03.SpringMVC-----源码分析与实践--初始化分析/">3.SpringMVC -初始化源码分析</a></li><li class="post-list-item"><a class="post-list-link" href="/maoge-blog/2018/07/12/花神(maoge)/9.Spring/SpringMVC--源码解读/02.SpringMVC-----源码分析与实践--环境搭建/">2.SpringMVC -源码分析与实践--环境搭建</a></li><li class="post-list-item"><a class="post-list-link" href="/maoge-blog/2018/07/12/花神(maoge)/7.JAVA_WEB相关技术/1.基于AsyncRestTemplate异步HTTP请求的一种轻量级技术实现/">1.基于AsyncRestTemplate异步HTTP请求的一种轻量级技术实</a></li><li class="post-list-item"><a class="post-list-link" href="/maoge-blog/2018/07/12/花神(maoge)/9.Spring/SpringMVC--源码解读/01.SpringMVC-----源码分析与实践----初步认知/">1.SpringMVC -源码分析与实践----初步认知</a></li><li class="post-list-item"><a class="post-list-link" href="/maoge-blog/2018/07/05/花神(maoge)/1.并发编程/20.并发编程--并发框架-Disruptor--应用示例3/">20.并发编程--并发框架-Disruptor--应用示例3</a></li><li class="post-list-item"><a class="post-list-link" href="/maoge-blog/2018/07/05/花神(maoge)/1.并发编程/19.并发编程--并发框架-Disruptor--应用示例2/">19并发编程--并发框架-Disruptor--应用示例2</a></li><li class="post-list-item"><a class="post-list-link" href="/maoge-blog/2018/07/05/花神(maoge)/1.并发编程/18.并发编程--并发框架-Disruptor--应用示例1/">18.并发编程--并发框架-Disruptor--应用示例1</a></li><li class="post-list-item"><a class="post-list-link" href="/maoge-blog/2018/07/05/花神(maoge)/1.并发编程/17.并发编程--并发框架-Disruptor--术语介绍/">17.并发编程--并发框架-Disruptor--介绍</a></li><li class="post-list-item"><a class="post-list-link" href="/maoge-blog/2018/07/05/花神(maoge)/1.并发编程/16.并发编程--并发框架-Disruptor--入门介绍/">16.并发编程--并发框架-Disruptor--介绍</a></li><li class="post-list-item"><a class="post-list-link" href="/maoge-blog/2018/07/05/花神(maoge)/1.并发编程/15.并发编程--锁-介绍/">15.并发编程--锁-介绍</a></li><li class="post-list-item"><a class="post-list-link" href="/maoge-blog/2018/07/05/花神(maoge)/1.并发编程/14.并发编程--Concurrent-工具类/">14.并发编程--Concurrent-工具类介绍</a></li><li class="post-list-item"><a class="post-list-link" href="/maoge-blog/2018/07/05/花神(maoge)/1.并发编程/13.并发编程--线程池介绍/">13. 并发编程--线程池</a></li><li class="post-list-item"><a class="post-list-link" href="/maoge-blog/2018/07/05/花神(maoge)/1.并发编程/12.并发编程--多线程设计模式 - 生产者-消费者模式/">12并发编程\12.并发编程--多线程设计模式 - 生产者-消费者模式</a></li><li class="post-list-item"><a class="post-list-link" href="/maoge-blog/2018/07/05/花神(maoge)/1.并发编程/11.并发编程--多线程设计模式 - Master-Worker模式/">11多线程设计模式 - Master-Worker模式</a></li><li class="post-list-item"><a class="post-list-link" href="/maoge-blog/2018/07/05/花神(maoge)/1.并发编程/7.并发编程--单例模式(饥饿模式-懒汉模式)/">7.并发编程--单例模式(饥饿模式-懒汉模式)</a></li><li class="post-list-item"><a class="post-list-link" href="/maoge-blog/2018/07/05/花神(maoge)/1.并发编程/10.并发编程--多线程设计模式 - Future模式/">10 多线程设计模式 - Future模式</a></li><li class="post-list-item"><a class="post-list-link" href="/maoge-blog/2018/07/05/花神(maoge)/1.并发编程/8.并发编程--同步类容器和并发类容器/">8并发编程--同步类容器和并发类容器</a></li><li class="post-list-item"><a class="post-list-link" href="/maoge-blog/2018/07/05/花神(maoge)/1.并发编程/6.并发编程--ThreadLocal/">6.并发编程--ThreadLocal</a></li><li class="post-list-item"><a class="post-list-link" href="/maoge-blog/2018/07/05/花神(maoge)/1.并发编程/9.并发编程--Queue/">9并发编程--Queue</a></li><li class="post-list-item"><a class="post-list-link" href="/maoge-blog/2018/07/05/花神(maoge)/1.并发编程/5.并发编程--多线程通信-wait-notify-模拟Queue/">并发编程--多线程通信-wait-notify-模拟Queue</a></li><li class="post-list-item"><a class="post-list-link" href="/maoge-blog/2018/07/05/花神(maoge)/1.并发编程/4-2.并发编程--多线程通信-wait-notify-notifyAll-join/">4-2.并发编程--并发编程--多线程通信-wait-notify-notifyAll-join</a></li><li class="post-list-item"><a class="post-list-link" href="/maoge-blog/2018/07/05/花神(maoge)/1.并发编程/4-1.并发编程--多线程通信-wait-notify/">4.并发编程--多线程通信-wait-notify</a></li><li class="post-list-item"><a class="post-list-link" href="/maoge-blog/2018/07/05/花神(maoge)/1.并发编程/1.并发编程--线程基础/">并发编程--线程基础</a></li><li class="post-list-item"><a class="post-list-link" href="/maoge-blog/2018/07/05/花神(maoge)/1.并发编程/3.并发编程--volatile 细节说明/">并发编程--volatile</a></li><li class="post-list-item"><a class="post-list-link" href="/maoge-blog/2018/07/05/花神(maoge)/1.并发编程/2.并发编程-synchronized 细节说明/">并发编程-synchronized 细节说明</a></li><li class="post-list-item"><a class="post-list-link" href="/maoge-blog/2018/07/05/花神(maoge)/1.并发编程/0.并发编程-readMe/">并发编程</a></li><li class="post-list-item"><a class="post-list-link" href="/maoge-blog/2018/05/05/花神(maoge)/2.网络编程/0.并发编程-readMe/">网络编程</a></li><li class="post-list-item"><a class="post-list-link" href="/maoge-blog/2018/05/05/花神(maoge)/2.网络编程/13.网络编程--Netty-文件的上传和下载/">13.网络编程--Netty-文件的上传和下载</a></li><li class="post-list-item"><a class="post-list-link" href="/maoge-blog/2018/05/05/花神(maoge)/2.网络编程/14.网络编程--mina-入门/">14.网络编程--mina-入门</a></li><li class="post-list-item"><a class="post-list-link" href="/maoge-blog/2018/05/05/花神(maoge)/2.网络编程/12.网络编程--Netty-实践-心跳检测/">12.网络编程--Netty-实践-心跳检测</a></li><li class="post-list-item"><a class="post-list-link" href="/maoge-blog/2018/05/05/花神(maoge)/2.网络编程/11.网络编程--Netty-实践-数据通信/">11.网络编程--Netty-实践-数据通信+心跳检测</a></li><li class="post-list-item"><a class="post-list-link" href="/maoge-blog/2018/05/05/花神(maoge)/2.网络编程/10.网络编程--Netty-基础-WebSocket/">10.网络编程--Netty-基础-WebSocket</a></li><li class="post-list-item"><a class="post-list-link" href="/maoge-blog/2018/05/05/花神(maoge)/2.网络编程/9.网络编程--Netty-基础-UDP/">9.网络编程--Netty-UDP</a></li><li class="post-list-item"><a class="post-list-link" href="/maoge-blog/2018/05/05/花神(maoge)/2.网络编程/8.网络编程--Netty-基础-拆包粘包-2/">8.网络编程--Netty-拆包粘包</a></li><li class="post-list-item"><a class="post-list-link" href="/maoge-blog/2018/05/05/花神(maoge)/2.网络编程/7.网络编程--Netty-基础-拆包粘包-1/">7.网络编程--Netty-拆包粘包</a></li><li class="post-list-item"><a class="post-list-link" href="/maoge-blog/2018/05/05/花神(maoge)/2.网络编程/6.网络编程--Netty-基础-HelloWorld/">6.网络编程--Netty-HelloWorld</a></li><li class="post-list-item"><a class="post-list-link" href="/maoge-blog/2018/05/05/花神(maoge)/2.网络编程/5.网络编程--Netty-基础-入门/">5.网络编程--Netty-入门</a></li><li class="post-list-item"><a class="post-list-link" href="/maoge-blog/2018/05/05/花神(maoge)/2.网络编程/4.网络编程--基础-AIO异步实现/">4.网络编程--基础-AIO异步实现</a></li><li class="post-list-item"><a class="post-list-link" href="/maoge-blog/2018/05/05/花神(maoge)/2.网络编程/3.网络编程--基础-NIO异步实现/">3.网络编程--基础-NIO异步实现</a></li><li class="post-list-item"><a class="post-list-link" href="/maoge-blog/2018/05/05/花神(maoge)/2.网络编程/2.网络编程--基础-BIO伪异步实现/">网络编程--基础</a></li><li class="post-list-item"><a class="post-list-link" href="/maoge-blog/2018/05/05/花神(maoge)/2.网络编程/1.网络编程--基础-socket/">网络编程--基础</a></li><li class="post-list-item"><a class="post-list-link" href="/maoge-blog/2018/04/05/花神(maoge)/5.分布式--zookeeper/2.zookeeper--集群搭建/">2.分布式--zookeeper\2.zookeeper--集群搭建</a></li><li class="post-list-item"><a class="post-list-link" href="/maoge-blog/2018/04/05/花神(maoge)/5.分布式--zookeeper/1.zookeeper--简介/">1.分布式--zookeeper--zookeeper简介</a></li><li class="post-list-item"><a class="post-list-link" href="/maoge-blog/2018/02/05/花神(maoge)/4.JVM相关/1.jvm虚拟机组成部分/">1.jvm虚拟机组成部分</a></li><li class="post-list-item"><a class="post-list-link" href="/maoge-blog/2018/02/05/花神(maoge)/3.缓存-中间件/Redis 配置文件说明/">Redis集群搭建-配置文件</a></li><li class="post-list-item"><a class="post-list-link" href="/maoge-blog/2018/02/05/花神(maoge)/3.缓存-中间件/Redis----集群搭建/">Redis集群搭建-实践</a></li></ul>




    <script>
        
    </script>
</div>
      <footer id="footer">
    <div class="outer">
        <div id="footer-info">
            <div class="footer-left">
                <i class="fa fa-copyright"></i> 
                2016-2018 zhengweiMao
            </div>
            <div class="footer-right">
                <a href="http://hexo.io/" target="_blank" title="快速、简洁且高效的博客框架">Hexo</a>  Theme <a href="https://github.com/MOxFIVE/hexo-theme-yelee" target="_blank" title="简而不减 Hexo 双栏博客主题  v3.5">Yelee</a> by MOxFIVE <i class="fa fa-heart animated infinite pulse"></i>
            </div>
        </div>
        
            <div class="visit">
                
                    <span id="busuanzi_container_site_pv" style='display:none'>
                        <span id="site-visit" title="本站到访数"><i class="fa fa-user" aria-hidden="true"></i><span id="busuanzi_value_site_uv"></span>
                        </span>
                    </span>
                
                
                    <span>| </span>
                
                
                    <span id="busuanzi_container_page_pv" style='display:none'>
                        <span id="page-visit"  title="本页阅读量"><i class="fa fa-eye animated infinite pulse" aria-hidden="true"></i><span id="busuanzi_value_page_pv"></span>
                        </span>
                    </span>
                
            </div>
        
    </div>
</footer>
    </div>
    
<script data-main="/maoge-blog/js/main.js" src="//cdn.bootcss.com/require.js/2.2.0/require.min.js"></script>

    <script>
        $(document).ready(function() {
            var iPad = window.navigator.userAgent.indexOf('iPad');
            if (iPad > -1 || $(".left-col").css("display") === "none") {
                var bgColorList = ["#9db3f4", "#414141", "#e5a859", "#f5dfc6", "#c084a0", "#847e72", "#cd8390", "#996731"];
                var bgColor = Math.ceil(Math.random() * (bgColorList.length - 1));
                $("body").css({"background-color": bgColorList[bgColor], "background-size": "cover"});
            }
            else {
                var backgroundnum = 5;
                var backgroundimg = "url(/background/bg-x.jpg)".replace(/x/gi, Math.ceil(Math.random() * backgroundnum));
                $("body").css({"background": backgroundimg, "background-attachment": "fixed", "background-size": "cover"});
            }
        })
    </script>





<div class="scroll" id="scroll">
    <a href="#" title="返回顶部"><i class="fa fa-arrow-up"></i></a>
    <a href="#comments" onclick="load$hide();" title="查看评论"><i class="fa fa-comments-o"></i></a>
    <a href="#footer" title="转到底部"><i class="fa fa-arrow-down"></i></a>
</div>
<script>
    // Open in New Window
    
        var oOpenInNew = {
            
            
            
            
            
            
             archives: ".archive-article-title", 
             miniArchives: "a.post-list-link", 
            
             friends: "#js-friends a", 
             socail: ".social a" 
        }
        for (var x in oOpenInNew) {
            $(oOpenInNew[x]).attr("target", "_blank");
        }
    
</script>

<script async src="https://dn-lbstatics.qbox.me/busuanzi/2.3/busuanzi.pure.mini.js">
</script>
  </div>
</body>
</html>